package test1;

public class student {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if(age<=6){
            this.age=7;
        }else{
            this.age=age;
        }
    }
    public student(){
        age=7;
        name="无名";
        System.out.println("无构造方法");
    }

    public void display(){
        System.out.println("name:"+name+","+"age:"+age);
    }
}
